package cn.edu.nju.oraldefense.model;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 
 * @author ZhangZu 此类代表论文
 */
@Entity
@Table(name = "paper")
public class Paper {

	private int id;
	private String title;
	private String file;
	// private Date time;
	private int state;
	private Graduate graduate;
	private List<Comment> commentList;

	private final String[] strState = { "待评阅", "评阅通过", "评阅未通过" };

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getFile() {
		return file;
	}

	public void setFile(String file) {
		this.file = file;
	}

	/*
	 * public Date getTime() { return time; }
	 * 
	 * public void setTime(Date time) { this.time = time; }
	 */

	public int getState() {
		return state;
	}

	@Transient
	public String getStrState() {
		return strState[state];
	}

	public void setState(int state) {
		this.state = state;
	}

	@ManyToOne
	@JoinColumn(name = "gid")
	public Graduate getGraduate() {
		return graduate;
	}

	public void setGraduate(Graduate graduate) {
		this.graduate = graduate;
	}

	@Transient
	public List<Comment> getCommentList() {
		return commentList;
	}

	public void setCommentList(List<Comment> commentList) {
		this.commentList = commentList;
	}

}
